import axios from '@/libs/axios1'
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' }
let base = '/testplatform/productTag'

// 查询产品分类标签列表
export const queryProductTagList = params => {
    return axios({
        url: `${base}/getPageList`,
        method: 'GET',
        params,
        headers: jsonHeaders,
    })
}

// 创建产品分类标签
export const addProductTag = data => {
    return axios({
        url: `${base}`,
        method: 'POST',
        data,
        headers: jsonHeaders,
    })
}

// 修改产品分类标签
export const updateProductTag = data => {
    return axios({
        url: `${base}`,
        method: 'PUT',
        data,
        headers: jsonHeaders,
    })
}

// 删除产品分类标签
export const deleteProductTag = id => {
    return axios({
        url: `${base}/${id}`,
        method: 'DELETE',
        headers: jsonHeaders,
    })
}

// 获取绑定次数最多的产品分类标签，支持分页查询
export const getBindMax = params => {
    return axios({
        url: `${base}/getBindMax`,
        method: 'GET',
        params,
        headers: jsonHeaders,
    })
}

// 查询产品已使用的标签
export const getProductUseTag = id => {
    return axios({
        url: `${base}/getProductUseTag/${id}`,
        method: 'GET',
        headers: jsonHeaders,
    })
}
